<?php

trait CoreTraitRedisSet
{

    private ?Redis $instance = null;

    public function sAdd($key, ...$value1)
    {
        $this->instance->sAdd($key, ...$value1);
    }

    public function sCard($key)
    {
        $this->instance->sCard($key);
    }

    public function sDiff($key1, ...$otherKeys)
    {
        $this->instance->sDiff($key1, ...$otherKeys);
    }

    public function sDiffStore($dstKey, $key1, ...$otherKeys)
    {
        $this->instance->sDiffStore($dstKey, $key1, ...$otherKeys);
    }

    public function sInter($key1, ...$otherKeys)
    {
        $this->instance->sInter($key1, ...$otherKeys);
    }

    public function sInterStore($key, $value)
    {
        $this->instance->sIsMember($key, $value);
    }

    public function sMembers($key)
    {
        return $this->instance->sMembers($key);
    }

    public function sMove($srcKey, $dstKey, $member)
    {
        $this->instance->sMove($srcKey, $dstKey, $member);
    }

    public function sPop($key, $count = 1)
    {
        $this->instance->sPop($key, $count = 1);
    }

    public function sRandMember($key, $count = 1)
    {
        $this->instance->sRandMember($key, $count = 1);
    }

    public function sRem($key, ...$member1)
    {
        $this->instance->sRem($key, ...$member1);
    }

    public function sScan($key, &$iterator, $pattern = null, $count = 0)
    {
        $this->instance->sScan($key, $iterator, $pattern = null, $count = 0);
    }

    public function sUnion($key1, ...$otherKeys)
    {
        $this->instance->sUnion($key1, ...$otherKeys);
    }

    public function sUnionStore($dstKey, $key1, ...$otherKeys)
    {
        $this->instance->sUnionStore($dstKey, $key1, ...$otherKeys);
    }

}